package com.example.shopping2.a_c_fragment.home.adapter

import android.view.View
import android.view.ViewGroup
import android.widget.BaseAdapter
import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView
import com.example.shopping2.R
import com.example.shopping2.a_c_fragment.home.entity.Notice_Entity
import com.youth.banner.Banner
import com.youth.banner.adapter.BannerAdapter
import com.youth.banner.util.BannerUtils

class Notice_Adapter : BannerAdapter<Notice_Entity, Notice_Adapter.NoticeHolder> {
    constructor(list: ArrayList<Notice_Entity>) : super(list) {

    }

    override fun onCreateHolder(parent: ViewGroup, viewType: Int): NoticeHolder {
        return NoticeHolder(BannerUtils.getView(parent, R.layout.notice_text))
    }

    override fun onBindView(holder: NoticeHolder, data: Notice_Entity, position: Int, size: Int) {
        holder.title?.setText(""+data.title)
    }
    class NoticeHolder : RecyclerView.ViewHolder {
        var title: TextView? = null
        constructor(itemview:View) : super(itemview){
            title = itemview.findViewById(R.id.notice_txt)
        }


    }
//    class NoticeHolder : RecyclerView.ViewHolder {
//        var title: TextView? = null
//
//        constructor(itemView: View) : super(itemView) {
//            title = itemView.findViewById(R.id.notice_txt)
//        }
//    }




}